package cn.com.b2office.struts2.servlet;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.context.support.WebApplicationContextUtils;

import cn.com.b2office.dao.LoadDataDao;
import cn.com.b2office.domain.Article;
import cn.com.b2office.domain.Category;
import cn.com.b2office.domain.Item;
/**
 * 程序启动时要加载的一些数据
 * 缓存加载(Item\Category\Delivery)
 * 配置文件加载
 * ....(继续增加)
 * @author Administrator
 *
 */
public class LoadOnServlet extends HttpServlet {

	private static final long serialVersionUID = 5981546194190382571L;
	
	private static final Log logger=LogFactory.getLog(LoadOnServlet.class);
	
	public void init() throws ServletException {
		// WebApplicationContext ctx =
		// WebApplicationContextUtils.
		// getRequiredWebApplicationContext(
		// this.getServletContext());
		// LoadDataDao loadDataDao=(LoadDataDao)ctx.getBean("loadDataDao");
		// loadDataDao.loadData(Item.class);
		// logger.info("load data: Item");
		// loadDataDao.loadData(Category.class);
		// logger.info("load data: Category");
		// loadDataDao.loadData(Article.class);
		// logger.info("load data: Article");
		
		//后续添加
	}

	public void service(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
	}

}
